package com.fick.hibernate;

import java.util.Properties;

import org.hibernate.HibernateException;
import org.hibernate.cfg.Environment;
import org.hibernate.connection.C3P0ConnectionProvider;

public class MyHibernateProvider extends C3P0ConnectionProvider {

	@Override
	public void configure(Properties props) throws HibernateException {
		String user = props.getProperty(Environment.USER);
		String password = props.getProperty(Environment.PASS);
		props.setProperty(Environment.USER, HibernateProvideUtils.decrypt(user));
		props.setProperty(Environment.PASS, HibernateProvideUtils.decrypt(password));
		super.configure(props);
	}

}
